<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import = "java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="formHandler" class="com.burger.counter.jspValidation.RegistrationValidation" scope="request" />

<%
Hashtable regionList;
int noregion;
int i=1;
%>
<%
regionList=(Hashtable)session.getAttribute("regionData");
noregion = regionList.size();

User[] userList = (User[]) session.getAttribute("UserAccountData");
%>

<%@page import="com.burger.counter.beans.User"%><html>
<script language="javascript" type="text/javascript" src="datetimepicker.js">
</script>

<head> </head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Counter Burger Online Registration</title>
<body>

<link rel="stylesheet" href="default.css" type="text/css"></link>
<%@ include file="header.jsp" %>

	<form name ="registerForm" method="post" action="RegisterUpdateRedirect.jsp">
	
	<div class ="inputColumn" id = "createAccount"  
			style="text-align: center; border: thin; margin: auto;">
			
		<table cellpadding=2 cellspacing=1 border="1" width="250">
			<th colspan=2>
				<h3>New User? <small>Start here to Register:</small></h3>
				<font size=2 color="red"><sup>*</sup> Required Fields</font>
			</th>
			<tr>
			<td valign=top align="left" style="font-family: Comic Sans MS"> 
				<b>First Name<sup style="color: red">*</sup></b> 
			<br>
				<input type="text" name="firstName" value='<%=userList[0].getFirstName()%>' 
								size=35 maxlength=20 style="background-color:#eeeeee">
				<label style="size: 32; color: red"><%=formHandler.getErrorMsg("firstName")%></label>	
			</td>
			<td  valign=top align="left" style="font-family: Comic Sans MS">
			<b>Last Name<sup style="color: red">*</sup></b>
			<br>
				<input type="text" name="lastName" value='<%=userList[0].getLastName()%>'
							 size=35 maxlength=20 style="background-color:#eeeeee">
		 		<label style="size: 32; color: red"><%=formHandler.getErrorMsg("lastName")%></label>
		 	</td>
			</tr>
			<tr>
			<td valign=top align="left" style="font-family: Comic Sans MS;">
				<b>Date of Birth<sup style="color: red">*</sup></b> 
			<input id="dateText" name="dateOfBirth" type="text" readonly="readonly" 
					value='<%=session.getAttribute("DOB")%>' size="25" style="background-color:#eeeeee">
						<a href="javascript:NewCal('dateText','MMDDYYYY')">
						<img src="image/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>
			<br>
				<label style="size: 25; color: red"><%=formHandler.getErrorMsg("dateText")%></label>	
			</td>
			<td  valign=top align="left"  style="font-family: Comic Sans MS;" >
				<b>Zip Code<sup style="color: red">*</sup></b> 
			<br>
				<input type="text" name="zip" value= '<%=userList[0].getZipcode()%>'
								 size=10  maxlength=8 style="background-color:#eeeeee">
			<br>
				<label style="size: 25; color: red"><%=formHandler.getErrorMsg("zip")%></label>
			</td>
			</tr>
			<tr>
			<td  valign=top align="left"  style="font-family: Comic Sans MS;" >
				<b>Pick Up Location<sup style="color: red">*</sup></b> 
			<br>
			<select name="regionData" style="background-color:#eeeeee"> 
				<option value= "0">---Select Location---</option>
				<% 
					Enumeration<Integer> regionid = regionList.keys();
					while(regionid.hasMoreElements())
					{
						Integer index = regionid.nextElement();
					%>
						<option value="<%=index%>"><%=regionList.get(index)%></option>
					<%	
					}
					%>		
				</select>
				
				<script>   
				document.getElementById("regionData").options.value = '<%= userList[0].getRegionID()%>';   
				</script>
				
				<label style="size: 35; color: red"><%=formHandler.getErrorMsg("regionData")%></label> 
			</td>
			<td valign=top align="left" style="font-family: Comic Sans MS;">
				<b>E-Mail<sup style="color: red">*</sup></b> 
			<br>
				<input type="text" name="email" value='<%=userList[0].getEmail()%>' readonly="readonly"
									size=35  maxlength=125 style="background-color:#eeeeee">
				<label style="size: 35; color: red"><%=formHandler.getErrorMsg("email")%></label>
			</td>
			</tr>
			<tr>
			<td valign=top align="left"  style="font-family: Comic Sans MS;">
				<b>Password<sup style="color: red">*</sup></b> 
			<br>
				<input type="password" name="password1" size=35 value="" 
											maxlength=10 style="background-color:#eeeeee">
				<label style="size: 25; color: red"><%=formHandler.getErrorMsg("password1")%></label>	
			</td>
			<td  valign=top align="left"  style="font-family: Comic Sans MS;">
			<b>Confirm Password<sup style="color: red">*</sup></b>
			<br>
				<input type="password" name="password2" size=35 value="" 
											maxlength=10 style="background-color:#eeeeee">
				<label style="size: 25; color: red"><%=formHandler.getErrorMsg("password2")%></label>
			</td>
			</tr>
			<tr>
				<td  align="center" colspan=2>
				<input type="submit" value="Update"> 
				<input type="button" value="Cancel" onclick="document.location.href='burger_type.jsp'">
			</td>
			</tr>
			</table>
						
 	</div>
	 </form>
</body>
</html>